package com.godyao.service;


import com.godyao.enums.ResultMsg;
import com.godyao.pojo.SecKillMessage;

/**
 * @author godyao
 * @date 2022/3/17
 */
public interface SecKillService {
    ResultMsg secKill(Long goodsId);

    void makeOrder(SecKillMessage secKillMessage);

    /**
     * 查询订单状态
     * @param goodsId
     * @return
     */
    Integer getOrderStatus(Long goodsId);

    /**
     * 根据goodsId和userId生成秒杀code 构成秒杀地址
     * @return
     */
    String generateSecKillCode(Long goodsId);

    /**
     * 检验url code的合法性
     * @param code
     * @param goodsId
     * @return
     */
    Boolean checkUrlInvalid(String code, Long goodsId);
}
